package com.example.demo.entity.two;

import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.stereotype.Controller;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by pengwan on 2017/6/25.
 */
@Entity
@Table(name="B_DEVICEITEM")
@SQLDelete(sql = "Update B_DEVICEITEM SET is_del = 'true' where id=?")
@Where(clause = "is_del != 'true'")
public class DeviceItem extends EntityBaseInfo implements Serializable {
    @Id
    @GeneratedValue
    @Column(name = "deviceitemid")
    private int deviceItemId;
    @Column(name="deviceitemname")
    private String deviceItemName;
    @Column(name="deviceitemsort")
    private int deviceItemSort;
    @Column(name="initvalue")
    private String initValue;

    @JoinColumn(name="itemzidiantype_id")
    @OneToOne(fetch = FetchType.LAZY)
    private DeviceItemZiDianType deviceItemZiDianType;

    @Column(name = "itemzidiantype_id",insertable = false,updatable = false)
    private int itemzidiantype_id;

    @Column(name="isrequire",columnDefinition = "char")
    private char isRequire;
    @Column(name="devicepage_id")
    private int devicePage_Id;
    @Column(name="deviceitembm",columnDefinition = "varchar(30)")
    private String deviceItemBM;
    @Column(name="wulidanwei_id",columnDefinition = "nvarchar(20)")
    private String wuliDanWei_Id;
    @Column(name="itemdatatype",columnDefinition = "nchar(10)")
    private String itemDataType;
    @Column(name="note",columnDefinition = "nvarchar(50)")
    private String note;
    @Column(name="controlstype",columnDefinition = "nvarchar(10)")
    private String controlsType;
    @Column(name = "is_del", columnDefinition = "nchar(10) default 'false'")
    private String isDel;

    public int getDeviceItemId() {
        return deviceItemId;
    }

    public void setDeviceItemId(int deviceItemId) {
        this.deviceItemId = deviceItemId;
    }

    public String getDeviceItemName() {
        return deviceItemName;
    }

    public void setDeviceItemName(String deviceItemName) {
        this.deviceItemName = deviceItemName;
    }

    public int getDeviceItemSort() {
        return deviceItemSort;
    }

    public void setDeviceItemSort(int deviceItemSort) {
        this.deviceItemSort = deviceItemSort;
    }

    public String getInitValue() {
        return initValue;
    }

    public void setInitValue(String initValue) {
        this.initValue = initValue;
    }

    public DeviceItemZiDianType getDeviceItemZiDianType() {
        return deviceItemZiDianType;
    }

    public void setDeviceItemZiDianType(DeviceItemZiDianType deviceItemZiDianType) {
        this.deviceItemZiDianType = deviceItemZiDianType;
    }

    public char getIsRequire() {
        return isRequire;
    }

    public void setIsRequire(char isRequire) {
        this.isRequire = isRequire;
    }

    public char isRequire() {
        return isRequire;
    }

    public void setRequire(char require) {
        isRequire = require;
    }

    public int getDevicePage_Id() {
        return devicePage_Id;
    }

    public void setDevicePage_Id(int devicePage_Id) {
        this.devicePage_Id = devicePage_Id;
    }

    public String getDeviceItemBM() {
        return deviceItemBM;
    }

    public void setDeviceItemBM(String deviceItemBM) {
        this.deviceItemBM = deviceItemBM;
    }

    public String getWuliDanWei_Id() {
        return wuliDanWei_Id;
    }

    public void setWuliDanWei_Id(String wuliDanWei_Id) {
        this.wuliDanWei_Id = wuliDanWei_Id;
    }

    public String getItemDataType() {
        return itemDataType;
    }

    public void setItemDataType(String itemDataType) {
        this.itemDataType = itemDataType;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getControlsType() {
        return controlsType;
    }

    public void setControlsType(String controlsType) {
        this.controlsType = controlsType;
    }

    public int getItemzidiantype_id() {
        return itemzidiantype_id;
    }

    public void setItemzidiantype_id(int itemzidiantype_id) {
        this.itemzidiantype_id = itemzidiantype_id;
    }

    public String getIsDel() {
        return isDel;
    }

    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
}

